wp get menu

40

wp_nav_menu(array(
	'menu' => "main-menu",
	// find all options at https://developer.wordpress.org/reference/functions/wp_nav_menu/
));
wp_nav_menu( array(
    'menu' => 'TEST',
    'menu_class' => "", 
    'menu_id'   => "",
    'container' => false
) );
$menu_name = 'sidebar-menu'; //menu slug
$locations = get_nav_menu_locations();
$menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
$menuitems = wp_get_nav_menu_items( $menu->term_id, array( 'order' => 'DESC' ) );

echo "<pre>";
print_r($menuitems);
echo "</pre>";

Comments

Submit
0 Comments